<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 2000px;
            background: red;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <script>
        // 获取浏览器宽度 
        // innerWidth :包含滚动条的宽度
        // console.log( innerWidth);

        // 获取不包含滚动条的宽度？直接获取html元素的宽度：document.documentElement.clientWidth
        console.log( document.documentElement.clientWidth);



    </script>
</body>
</html>